import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import login from "@/components/Login";
import main from "@/components/Main";
import register from "@/components/Register";
import order from "@/components/Order";
import book from "@/components/Book";
import gou from "@/components/Gou";
import activty from "@/components/Activty"

const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/login',
      name: 'login',
      component:()=>import('../components/Login')
    },
    {
      path: '/',
      name: 'main',
      component:()=>import('../components/Main'),
      children:[
        {
          path: '/order',
          name: 'order',
          component:()=>import('../components/Order')
        },
        {
          path: '/book',
          name: 'book',
          component:()=>import('../components/Book')
        },
        {
          path:'/gou',
          name:'gou',
          component:()=>import('../components/Gou')
        },
        {
          path:'/activty',
          name:'activty',
          component:()=>import('../components/Activty')
        }
      ]
    },
    {
      path: '/register',
      name: 'register',
      component:()=>import('../components/Register')
    },

  ]
})
